﻿CREATE PROCEDURE admin.s_CreateDocs
	@FileName sysname
AS
DECLARE @SQL varchar(max)
		SET @SQL = '
<style type="text/css">
table {border-collapse:collapse}
table thead tr {background:lightgrey}
</style>'
EXEC sp_DeleteFile @FileName
EXEC sp_AppendToFile @FileName,@SQL	
SELECT @SQL = ''
select @SQL = @SQL+'exec admin.s_help '''+name+''','''+SCHEMA_NAME(o.schema_id)+''','''+@FileName+'''
' from sys.objects o
WHERE type in ('FT','U ','V ','P ','TF','PC','FN','AF','IF','FS') and is_ms_shipped = 0
	AND schema_id = 1
ORDER BY name
--PRINT @SQL
EXEC (@SQL)
